package com.example.zheng.els2.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.example.zheng.els2.R;
import com.example.zheng.els2.service.MusicService;


public class MainActivity extends AppCompatActivity implements View.OnClickListener{


    //定义所有要用的控件
    private ImageView startGame;
    private ImageView setUp;
    private ImageView aboutMe;
    private ImageView custom;




    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //去掉标题栏
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        //去掉手机上的状态栏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);

        //得到控件
        startGame=(ImageView)findViewById(R.id.startGame);
        setUp=(ImageView)findViewById(R.id.setUp);
        aboutMe=(ImageView)findViewById(R.id.aboutMe);
        custom=(ImageView)findViewById(R.id.custom);


        //绑定监听事件
        startGame.setOnClickListener(this);
        setUp.setOnClickListener(this);
        aboutMe.setOnClickListener(this);
        custom.setOnClickListener(this);



    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.startGame:
                Intent intent=new Intent(this,GameActivity.class);
                startActivity(intent);

                break;

            case R.id.setUp:
                Intent intent1=new Intent(this,IntroducationActivity.class);
                startActivity(intent1);

                break;

            case R.id.aboutMe:
                Intent intent2=new Intent(this,Layouties.class);
                startActivity(intent2);

                break;

            case R.id.custom:
                Intent intent3=new Intent(this,Login.class);
                startActivity(intent3);

                break;
        }

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

    }
}